package com.chixing.ih.module.programmer.controller;

import com.chixing.ih.json.ResponseData;
import com.chixing.ih.module.programmer.pojo.dto.ProgrammerCompareDTO;
import com.chixing.ih.module.programmer.service.IProgrammerCompareService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @version 1.0
 * @Author MasterYan
 * @Date 2020/10/8
 * Time: 12:07
 */
@RestController
@RequestMapping("/programmerCompare")
@Api(tags = "程序员模块比较相关Api")
public class ProgrammerCompareController {

    @Autowired
    IProgrammerCompareService programmerCompareService;

    /**
     * desc:查看比程序员的接口
     *
     * @param ids
     * @return
     */
    @ApiOperation(value = "查看比程序员的接口", notes = "查看比较的程序员")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ids", value = "比较人的所有id", required = true, dataType = "long")
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
    })
    @GetMapping("/listProgrammerCompare")
    public Map<String, Object> listProgrammerCompare(@RequestParam("ids") List<Long> ids) {

        List<ProgrammerCompareDTO> programmerCompareDTOList = programmerCompareService.listProgrammer(ids);
        return ResponseData.REP_GET_SUCCESS(programmerCompareDTOList);
    }


}
